package com.hup.winHolderService;

import com.hup.utils.commons.exception.AppExceptionHandler;
import com.hup.utils.commons.exception.parser.WebApiAccessMsgParser;
import com.hup.utils.commons.start.LongBeanNameGenerator;
import com.hup.utils.commons.start.LookThemeUtil;
import com.hup.utils.commons.start.StartUpWindow;
import lombok.extern.slf4j.Slf4j;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.builder.SpringApplicationBuilder;
import org.springframework.context.annotation.ComponentScan;

/**
 * @author hugan
 * @date 2020/2/29
 */
@Slf4j
@ComponentScan(basePackages = {"com.hup.utils.commons.start", "com.hup.winHolderService"})
@SpringBootApplication
public class WinHolderService {

    public static void main(String[] args) {
        LookThemeUtil.initNormal(null);
        AppExceptionHandler.registerParser(new WebApiAccessMsgParser());
        StartUpWindow.startUp(WinHolderService::init);
    }

    private static void init() {
        SpringApplicationBuilder builder = new SpringApplicationBuilder(WinHolderService.class);
        builder.beanNameGenerator(new LongBeanNameGenerator()).run();
    }

}
